﻿<%@ Page Title="Home Page" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true"
    CodeBehind="Default.aspx.cs" Inherits="TeamWebSite._Default" %>
<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
</asp:Content>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
    <h2>
       Demo Team Site
    </h2>
    <p>
        <asp:ObjectDataSource ID="dsPlayer" runat="server" SelectMethod="GetAllPlayers" 
        TypeName="TeamWebSite.Data.Player" DeleteMethod="DeletePlayer" 
            UpdateMethod="EditPlayer">
            <DeleteParameters>
                <asp:Parameter Name="PlayerID" Type="Int32" />
            </DeleteParameters>
            <UpdateParameters>
                <asp:Parameter Name="PlayerName" Type="String" />
                <asp:Parameter Name="PlayerDescription" Type="String" />
                <asp:Parameter Name="PlayerAge" Type="Int32" />
            </UpdateParameters>
        </asp:ObjectDataSource>
        <asp:GridView ID="gvPlayer" runat="server" AllowPaging="True" 
        DataSourceID="dsPlayer" AutoGenerateColumns="False" DataKeyNames="PlayerID">
            <Columns>
                <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" />
                <asp:BoundField DataField="PlayerName" HeaderText="Player Name"  />
                <asp:BoundField DataField="PlayerDescription" HeaderText="Player Description"  />
                <asp:BoundField DataField="PlayerAge" HeaderText="Player Age"  />
            </Columns>
        </asp:GridView>
        <asp:Button ID="AddPerson" runat="server" Text="Add" 
        onclick="AddPerson_Click" />
    </p>
</asp:Content>
